

function FormatOperation(value,row,index){
    var peration = "<span class='btn btn-default' onclick='xiangqing("+JSON.stringify(row)+")'><i class='glyphicon glyphicon-edit'></i>详情</span>";
    return peration;
}
function FormatterState(value,row,index) {
    var name="";
    switch (value){
        case '0':
            name="待确认"
            break;
        case '1':
            name="已确认"
            break;
        case '2':
            name="未通过"
            break;
        case '3':
            name="通过"
            break;
    }
    return name;

}

function  addOrder() {
    var rows=$("#table").bootstrapTable("getSelections");
    if(rows.length==0){
        swal("请选择一项生成！");
        return;
    }
    var param="purchaseMasterId="+rows[0].purchaseMasterId+"&orderStatus=1";
    $.post("procurement/orderGenerate/update",param,function (msg) {
        swal(msg);
        $("#table").bootstrapTable("refresh");
    },'text')



}

function xiangqing(row) {
    location="procurement/orderGenerate/PurchaseMasterTo?id="+row.purchaseNo;
}

